<#assign ctx=request.contextPath />
<!DOCTYPE html>
<html lang="en">
<head>
    <title>工单统计</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link rel="stylesheet" href="${ctx}/css.css">
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.10&key=9b29a6048cb5ef7de6f503dc38e32d0c"></script>
    <script type="text/javascript" src="${ctx}/show-geom-list.js"></script>
</head>
<body>
<div style="height:0;"><a name="gotop">&nbsp;</a></div>
<div class="top">
    <a href="${ctx}/hello" class="backtrack"><img src="${ctx}/0.png"></a>
    <a href="javascript:history.back();" class="return"><img src="${ctx}/12.png"></a>
    <div class="box">
        工单统计
    </div>
</div>
<div class="empty"></div>
<#if (errors?? && errors?size>0)>
    <ul class="hint">
    <#list errors as err>
        <li>${err}</li>
    </#list>
    </ul>
</#if>

<form id="form1" action="${ctx}/lossMng/ticketList">
<table class="list_box">
    <tr>
        <td class="lo_3">选择DMA名称</td>
        <td class="lo_4">
            <select name="dmaId" class="zone">
                <#list dmaList as dma>
                    <option value="${dma.id!""}">${dma.name!""} (${dma.id!""})</option>
                </#list>
            </select>
        </td>
    </tr>
    <tr>
        <td class="lo_3 lo_5"><input id="srchBox" type="text" value="请输入关键词" class="lo_5 flow"></td>
        <td class="lo_4"><input type="submit" value="  搜索  " class="affirm_1"></td>
    </tr>
</table>
</form>
<div class="jump">
<div class="left"><a href="${ctx}/lossMng/ticketStatByDma"><b>按DMA分区统计</b></a></div>
<div class="right"><a href="${ctx}/lossMng/ticketStatByStuff"><b>按材质统计</b></a></div>
</div>
<div class="jump jump1">
<div class="left"><a href="${ctx}/lossMng/ticketStatByLossReason"><b>漏损原因统计</b></a></div>
<div class="right"><a href="${ctx}/lossMng/ticketStatByCancelReason"><b>终止工单统计</b></a></div>
</div>
<p class="show">
    <b>共 ${ticketList?size!"0"} 条工单:</b>
</p>
<#list ticketList as ticket>
<table class="list_box list_box1">
    <tr class="lo_7">
        <td class="lo_3">工单ID</td>
        <td class="lo_4">${ticket.ticketId}</td>
    </tr>
    <tr>
        <td class="lo_3">DMA-ID</td>
        <td class="lo_4">${ticket.dmaId}</td>
    </tr>
    <tr>
        <td class="lo_3">DMA名称</td>
        <td class="lo_4">${ticket.dmaName}</td>
    </tr>
    <tr>
        <td class="lo_3">当前进度</td>
        <td class="lo_4">${ticket.curStep!""}</td>
    </tr>
    <tr>
        <td class="lo_3">漏损日期</td>
        <td class="lo_4">${(ticket.startDate?date)!""}</td>
    </tr>
    <tr>
        <td class="lo_3">起始漏量(m³/h)</td>
        <td class="lo_4">${(ticket.startLoss?string("0.0"))!""}</td>
    </tr>
    <tr>
        <td class="lo_3">最大漏量(m³/h)</td>
        <td class="lo_4">${(ticket.maxLoss?string("0.0"))!""}</td>
    </tr>
    <tr>
        <td class="lo_3">修后漏量(m³/h)</td>
        <td class="lo_4">${(ticket.afterLoss?string("0.0"))!""}</td>
    </tr>
    <tr>
        <td class="lo_3">管径</td>
        <td class="lo_4">${ticket.pipeSize!""}</td>
    </tr>
    <tr>
        <td class="lo_3">材质</td>
        <td class="lo_4">${ticket.pipeStuff!""}</td>
    </tr>
    <tr>
        <td class="lo_3">漏损原因</td>
        <td class="lo_4">${ticket.lossReason!""}</td>
    </tr>
    <tr>
        <td class="lo_3">发起</td>
        <td class="lo_4">${ticket.startId!""} 在 ${(ticket.startTime?datetime)!""}</td>
    </tr>
    <tr>
        <td class="lo_3">分配</td>
        <td class="lo_4">${ticket.senderId!""} 在 ${(ticket.sendTime?datetime)!""}</td>
    </tr>
    <tr>
        <td class="lo_3">探漏</td>
        <td class="lo_4">${ticket.finderId!""} 从 ${(ticket.claimFindTime?datetime)!""} 到 ${(ticket.findTime?datetime)!""}</td>
    </tr>
    <tr>
        <td class="lo_3">维修</td>
        <td class="lo_4">${ticket.fixerId!""} 从 ${(ticket.claimFixTime?datetime)!""} 到 ${(ticket.fixTime?datetime)!""}</td>
    </tr>
    <tr>
        <td class="lo_3">审核</td>
        <td class="lo_4">${ticket.auditorId!""} 在 ${(ticket.auditTime?datetime)!""}</td>
    </tr>
    <tr>
        <td class="lo_3">评分</td>
        <td class="lo_4">${(ticket.auditScore?string("0.0"))!"-"}</td>
    </tr>
    <tr>
        <td class="lo_3">确认漏量(m³/h)</td>
        <td class="lo_4">${(ticket.confirmFixLoss?string("0.0"))!"-"}</td>
    </tr>

    <tr>
        <td class="lo_3" rowspan="4">探漏结果</td>
        <td class="lo_4">
            ${ticket.findSummary!""}: ${(ticket.findLoss?string("0"))!""} m³/d<br/>
        </td>
    </tr>
    <tr>
        <td class="lo_4">
            <#if (ticket.findPhoto1)??>
                <a href="${ticket.findPhoto1}" target="_blank">
            <img src="${ticket.findPhoto1}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
                </a>
            </#if>
            <#if (ticket.findPhoto1b)??>
                <a href="${ticket.findPhoto1b}" target="_blank">
            <img src="${ticket.findPhoto1b}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
                </a>
            </#if>
        </td>
    </tr>
    <tr>
        <td class="lo_4">
            <#if (ticket.findPhoto2)??>
                <a href="${ticket.findPhoto2}" target="_blank">
            <img src="${ticket.findPhoto2}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
                </a>
            </#if>
            <#if (ticket.findPhoto2b)??>
                <a href="${ticket.findPhoto2b}" target="_blank">
            <img src="${ticket.findPhoto2b}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
                </a>
            </#if>
        </td>
    </tr>
    <tr>
        <td class="lo_4">
            <#if (ticket.findPhoto3)??>
                <a href="${ticket.findPhoto3}" target="_blank">
            <img src="${ticket.findPhoto3}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
                </a>
            </#if>
            <#if (ticket.findPhoto3b)??>
                <a href="${ticket.findPhoto3b}" target="_blank">
            <img src="${ticket.findPhoto3b}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
                </a>
            </#if>
        </td>
    </tr>

    <tr>
        <td class="lo_3" rowspan="4">维修结果</td>
        <td class="lo_4">
            ${ticket.fixSummary!""}: ${(ticket.fixLoss?string("0"))!""} m³/h<br/>
        </td>
    </tr>
    <tr>
        <td class="lo_4">
            <#if (ticket.fixPhoto1)??>
                <a href="${ticket.fixPhoto1}" target="_blank">
                <img src="${ticket.fixPhoto1}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
                </a>
            </#if>
            <#if (ticket.fixPhoto1b)??>
                <a href="${ticket.fixPhoto1b}" target="_blank">
                <img src="${ticket.fixPhoto1b}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
                </a>
            </#if>
            <#if (ticket.fixPhoto1c)??>
                <a href="${ticket.fixPhoto1c}" target="_blank">
            <img src="${ticket.fixPhoto1c}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
                </a>
            </#if>
        </td>
    </tr>
    <tr>
        <td class="lo_4">
        <#if (ticket.fixPhoto2)??>
            <a href="${ticket.fixPhoto2}" target="_blank">
        <img src="${ticket.fixPhoto2}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
            </a>
        </#if>
        <#if (ticket.fixPhoto2b)??>
            <a href="${ticket.fixPhoto2b}" target="_blank">
        <img src="${ticket.fixPhoto2b}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
            </a>
        </#if>
        <#if (ticket.fixPhoto2c)??>
            <a href="${ticket.fixPhoto2c}" target="_blank">
        <img src="${ticket.fixPhoto2c}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
            </a>
        </#if>
        </td>
    </tr>
    <tr>
        <td class="lo_4">
        <#if (ticket.fixPhoto3)??>
            <a href="${ticket.fixPhoto3}" target="_blank">
        <img src="${ticket.fixPhoto3}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
            </a>
        </#if>
        <#if (ticket.fixPhoto3b)??>
            <a href="${ticket.fixPhoto3b}" target="_blank">
        <img src="${ticket.fixPhoto3b}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
            </a>
        </#if>
        <#if (ticket.fixPhoto3c)??>
            <a href="${ticket.fixPhoto3c}" target="_blank">
        <img src="${ticket.fixPhoto3c}?x-oss-process=image/resize,w_200,limit_0" style="max-width: 200px;"/>
            </a>
        </#if>
        </td>
    </tr>

    <tr>
        <td class="lo_3">维修位置</td>
        <td class="lo_4">
            <div id="map_${ticket_index}" class="map"></div>
            <input type="hidden" id="fixLoc_${ticket_index}" value="${ticket.fixLoc!""}">
            <script>
                // 坐标格式： GEOMETRYCOLLECTION (POINT (114 23), POINT (115 22), POINT (113 23))
                var c = document.getElementById("fixLoc_${ticket_index}").value;
                showGeomList(c, "map_${ticket_index}")
            </script>
        </td>
    </tr>
    <tr>
        <td class="lo_3">是否取消</td>
        <td class="lo_4">
            <#if ticket.cancelTime??>
                ${ticket.canceller!""} 在 ${(ticket.cancelTime?datetime)!""} 终止工单, 原因是: ${ticket.cancelReason!""}.
                <#else>
                未取消
            </#if>
        </td>
    </tr>
    <tr>
    <td colspan="2">
        <#if ticket.cancelTime??>
            <img src="${ctx}/lo-3.png" class="seal">
            <#elseif ticket.auditTime??>
            <img src="${ctx}/lo-1.png" class="seal">
            <#else>
            <img src="${ctx}/lo-2.png" class="seal">
        </#if>
    </td>
    </tr>
</table>
</#list>
<div class="go">
	<a title="返回顶部" class="top_1" href="#gotop"></a>
	<a title="返回首页" class="feedback" href="${ctx}/hello"></a>
	<a title="返回底部" class="bottom" href="#gobottom"></a>
</div>
<div style="height:0;"><a name="gobottom">&nbsp;</a></div>
</body>
</html>